package solutions.leetcode.normal

/**
 * @author lizhidong
 * <a href="https://leetcode.cn/problems/maximum-number-of-consecutive-values-you-can-make/">1798. 你能构造出连续值的最大数目</a>
 */
private class Solution1798 {
    fun getMaximumConsecutive(coins: IntArray): Int {
        coins.sort()
        var max = 1
        for (item in coins) {
            if (item > max) {
                break
            } else {
                max += item
            }
        }
        return max
    }
}

fun main() {
    
}